function findLongestWordLength(str) {
    let longestWordLen = "";
    str.split(/\s+/).forEach(
        item => (longestWordLen = Math.max(longestWordLen, item.length))
    );
    return longestWordLen;
}

findLongestWordLength("The quick brown fox jumped over the lazy dog");
